#include"stdio.h"

int main()
{
	int a, b, c, a1, b1, c1, t;
	scanf_s("%d %d %d", &a, &b, &c);
	t = a % 3;
	a1 = a / 3;
	a = a1;
	b = b + a1;
	c = c + a1;
	t = t + b % 3;
	b1 = b / 3;
	b = b1;
	a = a + b1;
	c = c + b1;
	t = t + c % 3;
	c1 = c / 3;
	c = c1;
	a = a + c1;
	b = b + c1;
	printf("%d %d %d\n", a, b, c);
	printf("%d", t);
	return 0;
}